"use strict";
cc._RF.push(module, '33e3dfko1VMurdGR21iqG2M', 'SettingView');
// scripts/SettingView.js

"use strict";

var e = require;
var t = module;
var n = exports;
Object.defineProperty(n, "__esModule", {
  value: !0
});

var o = e("DataMgr"),
    i = e("SoundMgr"),
    a = e("Privacy"),
    r = cc._decorator,
    s = r.ccclass,
    c = r.property,
    l = function (e) {
  __extends(t, e);

  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.panel = null;
    t.audioOnSprite = null;
    t.audioOffSprite = null;
    t.androidBtns = null;
    return t;
  }

  n = t;

  t.prototype.onLoad = function () {
    n.Instance = this;
  };

  t.prototype.openPanel = function () {
    SDK.Base.Event.emit("PanelOpen");
    this.freshSprite();
    this.panel.active = !0; // cc.sys.platform != cc.sys.ANDROID && cc.sys.platform != cc.sys.OPPO_GAME && cc.sys.platform != cc.sys.XIAOMI_GAME && cc.sys.platform != cc.sys.VIVO_GAME || (this.androidBtns.active = !0)

    SDK.Mgr.Inst.showInsert();
  };

  t.prototype.audioSwitch = function () {
    0 != o["default"].Instance.audioVolume ? o["default"].Instance.audioVolume = 0 : o["default"].Instance.audioVolume = 1;
    i["default"].Instance.soundAudioSource.volume = o["default"].Instance.audioVolume;
    i["default"].Instance.musicAudioSource.volume = o["default"].Instance.audioVolume;
    this.freshSprite();
  };

  t.prototype.freshSprite = function () {
    if (1 == o["default"].Instance.audioVolume) {
      this.audioOnSprite.active = !0;
      this.audioOffSprite.active = !1;
    } else {
      this.audioOnSprite.active = !1;
      this.audioOffSprite.active = !0;
    }
  };

  t.prototype.yinsiClick = function () {
    SDK.Mgr.Inst.curChannel == SDK.Define.Channel.oppo || SDK.Mgr.Inst.curChannel == SDK.Define.Channel.vivo || SDK.Mgr.Inst.curChannel == SDK.Define.Channel.xm ? a["default"].Instance.openContext() : SDK.Mgr.Inst.privacy();
  };

  t.prototype.yonghuClick = function () {
    SDK.Mgr.Inst.agreement();
  };

  t.prototype.closeBtnClick = function () {
    SDK.Base.Event.emit("PanelClose");
    this.panel.active = !1;
  };

  var n;
  t.Instance = null;

  __decorate([c(cc.Node)], t.prototype, "panel", void 0);

  __decorate([c(cc.Node)], t.prototype, "audioOnSprite", void 0);

  __decorate([c(cc.Node)], t.prototype, "audioOffSprite", void 0);

  __decorate([c(cc.Node)], t.prototype, "androidBtns", void 0);

  return n = __decorate([s], t);
}(cc.Component);

n["default"] = l;

cc._RF.pop();